package pl.edu.agh.iosr.gamblingzone.model;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

/**
 * The Class BetOpaque.
 */
public class BetOpaque implements Serializable{

	/** The bet. */
	private Bet bet;
	
	/** The participants. */
	private List<Participant> participants = new LinkedList<Participant>();
	
	/** The event name. */
	private String eventName;
	
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 539223426765213438L;
	
	/**
	 * Instantiates a new bet opaque.
	 * 
	 * @param bet the bet
	 */
	public BetOpaque(Bet bet) {
		this.bet = bet;
		
		for (AbstractEvent event : bet.getEvents()) {
			participants.addAll(event.getRates().keySet());			
			eventName = event.getGroup().getName();
		}
	}

	/**
	 * Gets the bet.
	 * 
	 * @return the bet
	 */
	public Bet getBet() {
		return bet;
	}

	/**
	 * Sets the bet.
	 * 
	 * @param bet the new bet
	 */
	public void setBet(Bet bet) {
		this.bet = bet;
	}

	/**
	 * Gets the participants.
	 * 
	 * @return the participants
	 */
	public List<Participant> getParticipants() {
		return participants;
	}

	/**
	 * Sets the participants.
	 * 
	 * @param participants the new participants
	 */
	public void setParticipants(List<Participant> participants) {
		this.participants = participants;
	}

	/**
	 * Gets the event name.
	 * 
	 * @return the event name
	 */
	public String getEventName() {
		return eventName;
	}

	/**
	 * Sets the event name.
	 * 
	 * @param eventName the new event name
	 */
	public void setEventName(String eventName) {
		this.eventName = eventName;
	}
}
